package cn.edu.ctbu.datajpa01.service;

import cn.edu.ctbu.datajpa01.domain.Student;
import cn.edu.ctbu.datajpa01.domain.Teacher;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface TeacherService {
    List<Teacher> findAll();


    /**
     * 只分页的查询
     *
     * @param pageable
     * @return
     */

    Page<Teacher> findAll(Pageable pageable);

    /**
     * 带过滤
     *
     * @param studentExample
     * @param pageable
     * @return
     */
    Page<Teacher> findAll(Example<Teacher> studentExample, Pageable pageable);


    /**
     * 按id进行查询
     *
     * @param id 主键，整数
     * @return
     */
    Teacher findById(Integer id);

    /**
     * 按名字查询，like
     *
     * @param name
     * @return
     */

    List<Teacher> findByName(String name);
//
//    /**
//     * 按名字和密码查询
//     * @param name
//     * @param password
//     * @return
//     */
//    List<Teacher> findByNameAndPassword(String name,String password);

    Teacher insert(Teacher teacher);

    Teacher update(Teacher teacher);

    void delete(Teacher teacher);

    void delete(Integer id);

    Teacher getById(Integer id);
}
